Skip to content

fix(inbox): don't show onboarding while data is still loading#2392

Merged
Twixes merged 1 commit into
mainfrom
fix-inbox-onboarding-loading-race
May 27, 2026
Merged

fix(inbox): don't show onboarding while data is still loading#2392
Twixes merged 1 commit into
mainfrom
fix-inbox-onboarding-loading-race

Conversation

@Twixes
Copy link
Copy Markdown
Member

@Twixes Twixes commented May 27, 2026

Problem

In production, users with a configured inbox (lots of reports, sources enabled) were seeing the "Set up self-driving for your product" onboarding pane.

On first paint the queries haven't settled, so hasReports and hasSignalSources both read false. The previous code latched onboarding on that derived value via a ref mutated during render - so the first paint flipped the latch, and the latch is sticky for the visit.

Fix

Move the latch from a ref-mutated-in-render to a useEffect-driven useState. The setter is a no-op once true (React bails out), so no loops. Tested by running this.

The onboarding pane was latching on first render because both
hasReports and hasSignalSources read false before the queries
settled, so users with a configured inbox briefly saw the setup
view and the latch stuck for the visit.

Gate entry on the same prerequisites the sources dialog uses
(integrations + signal source configs loaded, reports query not
loading, no error), and move the latch into a useEffect.
@Twixes Twixes force-pushed the fix-inbox-onboarding-loading-race branch from dc91673 to 048b021 Compare May 27, 2026 12:32
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 27, 2026

Reviews (1): Last reviewed commit: "fix(inbox): don't show onboarding while ..." | Re-trigger Greptile

@Twixes Twixes requested review from adboio and andrewm4894 May 27, 2026 12:34
@Twixes Twixes enabled auto-merge (squash) May 27, 2026 12:38
@Twixes Twixes merged commit 7ea79df into main May 27, 2026
14 checks passed
@Twixes Twixes deleted the fix-inbox-onboarding-loading-race branch May 27, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants